package lance.honeydew.util;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.persistence.criteria.CriteriaBuilder.Case;

public class UserMemberUtil {

	public static Long IDENTITY_GENERAL_INT = new Long(0);
	
	public static Long IDENTITY_VIP_INT = new Long(1);
	
	public static Long IDENTITY_MANAGER_INT = new Long(99);
	
	public static String IDENTITY_GENERAL_Str = "一般會員";
	
	public static String IDENTITY_VIP_Str = "VIP會員";
	
	public static String IDENTITY_MANAGER_Str = "管理會員";
	
	public static Long STATE_USERMEMBER_ENABLE_INT = new Long(0);
	
	public static Long STATE_USERMEMBER_DISABLE_INT = new Long(1);
	
	public static String STATE_USERMEMBER_ENABLE_Str = "有效";
	
	public static String STATE_USERMEMBER_DISABLE_Str = "無效";
	
	public static String getIdentityStr(int value) {
		
		String result = "";
		
		switch(value) {
			case 0:
				result += IDENTITY_GENERAL_Str;
				break;
			case 1:
				result += IDENTITY_VIP_Str;
				break;
			case 99:
				result += IDENTITY_MANAGER_Str;
				break;
			default:
				result += "";
				break;
		}
		return result;
	}
	
	public List<Map> getIdentityList() {
		
		List<Map> result = new ArrayList<Map>();
		
		Map map;
		map = new HashMap();
		map.put("identityInt", IDENTITY_GENERAL_INT);
		map.put("identityStr", IDENTITY_GENERAL_Str);
		result.add(map);
		map = new HashMap();
		map.put("identityInt", IDENTITY_VIP_INT);
		map.put("identityStr", IDENTITY_VIP_Str);
		result.add(map);
		map = new HashMap();
		map.put("identityInt", IDENTITY_MANAGER_INT);
		map.put("identityStr", IDENTITY_MANAGER_Str);
		result.add(map);
		
		return result;
	}
	
	public String getStateStr(int value) {
		
		String result = "";
		
		switch(value) {
			case 0:
				result += STATE_USERMEMBER_ENABLE_Str;
				break;
			case 1:
				result += STATE_USERMEMBER_DISABLE_Str;
				break;
			default:
				result += "";
				break;
		}
		
		return result;
	}
}
